[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 CURCOLOR() (INTEGER)

 Function
  Returns the color (0-255) in use by the ANSI driver.

 Syntax
  CURCOLOR()   No arguments are required

 Return Type & Value
  INTEGER
  Returns the color code most recently issued to the ANSI driver.

 Remarks
  The @X code processor within PCBoard has the ability to save and
  restore color codes built in.  PCBoard accomplishes this by saving the
  current color whenever it encounters an @X00 and reissuing the color
  change when it encounters an @XFF.  Unfortunately, PCBoard will only
  remember one color at a time.  With this function you can save and
  restore as many colors as your application needs.

 Examples
  INTEGER cc,x,y
  COLOR @X0F
  ANSIPOS 26,23
  PRINT "Hit the SPACE BAR to continue"
  WHILE (KINKEY() <> " ") DO
    CLS
    LET x = 1+RANDOM(57)
    LET y = 1+RANDOM(21)
    PUSH 1+RANDOM(14)
    GOSUB sub
    LET cc = CURCOLOR()
    PUSH @X0F
    GOSUB sub
    PUSH cc
    GOSUB sub
    ANSIPOS 1,y
    CLREOL
  ENDWHILE

  :sub
  INTEGER c
  POP c
  COLOR c
  ANSIPOS x,y
  PRINT "PCBoard 15.0 with PPL!"
  DELAY 18
  RETURN

See Also:
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson